from celery import Celery
from app import create_app, celeryconfig


def make_celery(app_name):
    celery = Celery(app_name,
                    broker=celeryconfig.broker_url,
                    backend=celeryconfig.result_backend)
    celery.config_from_object(celeryconfig)
    return celery


my_celery = make_celery(__name__)

app = create_app(celery=my_celery)
